<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta charset="utf-8"/>
    <title th:text="${ lang.translate(title) }">Foxnic-Web</title>
    <link th:if(theme.ico!="null") rel="shortcut icon" th:href="${theme.ico}" type="image/vnd.microsoft.icon">
    <link th:if(theme.ico!="null") rel="icon" th:href="theme.ico" type="image/vnd.microsoft.icon">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="assets/libs/layui/css/layui.css" th:href="'assets/libs/layui/css/layui.css?'+${cacheKey}"/>
    <link rel="stylesheet" href="assets/css/admin.css" th:href="'assets/css/admin.css?'+${cacheKey}"/>
    <link rel="stylesheet" href="assets/libs/toast/css/toast.css" th:href="'assets/libs/toast/css/toast.css?'+${cacheKey}" type="text/css">
    <link href="/assets/libs/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
    <link href="/assets/libs/material-design-webfont/css/material-design-icons-min.css" rel="stylesheet">
    <style>
        /* 覆盖原始样式 */
        .xm-icon-close:before {
		    content: "";
		    display: none;
		}
    </style>
    <link rel="stylesheet" href="assets/css/foxnic-web.css" th:href="'assets/css/foxnic-web.css?'+${cacheKey}" >
    <link th:each="css:${theme.css}" rel="stylesheet" th:href="${css}+'?'+${cacheKey}">
    <script th:inline="javascript">var foxnic_cachekey=[[${cacheKey}]];</script>
	<link th:each="css:${theme.css}" rel="stylesheet" th:href="${css}+'?'+${cacheKey}">
</head>

<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <!-- 头部 存放用户登录信息-->
    <div class="layui-header"  p-com="header"></div>

    <!-- 左边菜单栏 关联 config.js  index.js side.html -->
    <div class="layui-side" p-com="side"></div>

    <!-- 主体部分 -->
    <div class="layui-body" style="bottom:8px">
        <div class="layui-tab" lay-allowClose="true" lay-filter="admin-pagetabs">
            <ul class="layui-tab-title">
            </ul>
            <div class="layui-tab-content">
            </div>
        </div>
        <div class="layui-icon admin-tabs-control layui-icon-prev" ew-event="leftPage"></div>
        <div class="layui-icon admin-tabs-control layui-icon-next" ew-event="rightPage"></div>
        <div class="layui-icon admin-tabs-control layui-icon-down">
            <ul class="layui-nav admin-tabs-select" lay-filter="admin-pagetabs-nav">
                <li class="layui-nav-item" lay-unselect>
                    <a href="javascript:"></a>
                    <dl class="layui-nav-child layui-anim-fadein">
                    	<dd ew-event="openInNewTab" lay-unselect><a href="javascript:">在新窗口中打开</a></dd>
                        <dd ew-event="closeThisTabs" lay-unselect><a href="javascript:">关闭当前标签页</a></dd>
                        <dd ew-event="closeOtherTabs" lay-unselect><a href="javascript:">关闭其它标签页</a></dd>
                        <dd ew-event="closeAllTabs" lay-unselect><a href="javascript:">关闭全部标签页</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <!-- 底部 -->
    <!--
    <div class="layui-footer">&nbsp;</span>
    </div>
    -->

    <!-- 手机屏幕遮罩层 -->
    <div class="site-mobile-shade"></div>
</div>
<script type="text/javascript" src="module/global.js" th:src="'module/global.js?'+${cacheKey}"></script>
<script th:each="js:${theme.js}" type="text/javascript" th:src="${js}+'?'+${cacheKey}"></script>
<script type="text/javascript" src="assets/libs/jquery-3.2.1.min.js" th:src="'assets/libs/jquery-3.2.1.min.js?'+${cacheKey}"></script>
<script type="text/javascript" src="assets/libs/toast/js/toast.js" th:src="'assets/libs/toast/js/toast.js?'+${cacheKey}"></script>
<script type="text/javascript" src="assets/libs/q.js" th:src="'assets/libs/q.js?'+${cacheKey}"></script>
<script type="text/javascript" src="assets/libs/pandyle.min.js" th:src="'assets/libs/pandyle.min.js?'+${cacheKey}"></script>
<script type="text/javascript" src="assets/libs/layui/layui.js" th:src="'assets/libs/layui/layui.js?'+${cacheKey}"></script>

<script>
    var MODULE_ENABLE= [[${moduleEnable}]];
    var LOGO="[[${logo}]]";
    var TABLE_PAGE_LEVELS=[[${tablePageLevels}]];
</script>

<script>
    localStorage.setItem("ui_table_page_levels", JSON.stringify(TABLE_PAGE_LEVELS));
    layui.config({
    	dir: '/assets/libs/layui/',
        base: '/module/'
    }).extend({
        formSelects: 'formSelects/formSelects-v4',
        xmSelect: 'xm-select/xm-select'
    }).use(['settings', 'index', 'element','xmSelect',"dropdown"], function () {
        let config = layui.settings;
        let index = layui.index;
        let element = layui.element;

        // 检查是否登录
        if (!config.getToken() || config.getToken() == '') {
            location.replace('login.html');
            return;
        }

        // 检查多标签功能是否开启
        index.checkPageTabs();

        // 获取当前用户信息
        index.getUser(function (user) {
        	//user=user.user;
        	//console.log(user);
        	user.headImgUrl="/service-storage/sys-file/download?id="+user.user.portraitId+"&catalog=portrait";
        	//user.headImgUrl="https://portrait.gitee.com/uploads/avatars/user/490/1470521_LeeFJ_1622844383.png!avatar200";
            user.logoImgUrl=LOGO;

        	$('.layui-layout-admin .layui-header').vm(user);
            index.initLeftNav();
            element.render('nav');
            index.initRouter();
            index.bindEvent();
        });
    });
</script>
</body>

</html>
